/**
* @author AlbertDarren
* @contact 2563491540@qq.com
*/
#include <cstdio>
#include <cmath>
using namespace std;

int main_1012()
{
    int N,num,A1=0,A2=0,A2C=-1,A3=0,A4Sum=0,A4Count=0,A5=0;
    scanf("%d",&N);
    for (int i=0;i<N ;++i )
    {
        scanf("%d",&num);
        switch (num%5)
        {
        case 0:
            if (num%2==0)
            {
                A1+=num;
            }
            break;
        case 1:
            A2C*=-1;
            A2+=A2C*num;
            break;
        case 2:
            ++A3;
            break;
        case 3:
            A4Sum+=num;
            ++A4Count;
            break;
        case 4:
            if (num>A5)
            {
                A5=num;
            }
            break;
        }
    }
    A1>0?printf("%d ",A1):printf("N ");
    A2>0?printf("%d ",A2):printf("N ");
    A3>0?printf("%d ",A3):printf("N ");
    A4Count>0?printf("%.1lf ",(double)A4Sum/A4Count):printf("N ");
    A5>0?printf("%d",A5):printf("N");
	return 0;
}
